package com.tedu.pj.sys.dao;

import com.tedu.pj.sys.pojo.SysUser;
import com.tedu.pj.sys.pojo.SysUserDeptVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author Song
 * @since 2020/10/20
 */
@Mapper
public interface SysUserDao {

    int getRowCount(String username);

    List<SysUserDeptVo> findPageObjects(@Param("username") String username, @Param("startIndex") Integer startIndex,
                                        @Param("pageSize") Integer pageSize);

    int validById(@Param("id") Integer id,
                  @Param("valid") Integer valid,
                  @Param("modifiedUser") String modifiedUser);

    int insertObject(SysUser entity);

    SysUserDeptVo findObjectById(Integer id);

    int updateObject(SysUser entity);

    int updatePassword(@Param("password") String password,
                       @Param("salt") String salt,
                       @Param("id") Integer id);

    SysUser findUserByUserName(String username);
}

